package digimon.random;

import java.util.Random;

public class RandomNumberGenerator {

	private Random random;
	/**
	 * RandomNumberGenerator is the class responsible for generate all random numbers in execution of the program
	 * @param seed The seed for the Random number generation
	 */
	public RandomNumberGenerator(long seed) {
		setRandom(new Random(seed));
	}
	
	/**
	 * GiveMeRandom Is the method utilized for give a random number
	 * @param i the intervall of the random number generated
	 * @return a random number based on the global seed
	 */
	synchronized public int giveMeRandom(int i){
		return getRandom().nextInt(i);
	}
	
	/**
	 * GiveMeRandom Is the method utilized for give a random number
	 * @return a random number based on the global seed
	 */
	synchronized public int giveMeRandom(){
		return getRandom().nextInt();
	}
	
	public Random getRandom() {
		return random;
	}
	public void setRandom(Random random) {
		this.random = random;
	}
}
